From 6d94f8a56c3385f1237e3be8ef20a4fb9b472636 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 27 Feb 2013 12:16:28 -0600 Subject: [PATCH] Don't allow drops in unmounted volumes Unmounted volumes don't have a URI yet, so we can use that to distinguish them from within the DnD code. Signed-off-by: Federico Mena Quintero --- gtk/gtkplacessidebar.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 517729afe7..63f9834078 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -1444,20 +1444,20 @@ drag_motion_callback (GtkTreeView *tree_view, if (!drop_as_bookmarks) { char *uri; - GFile *dest_file; gtk_tree_model_get (GTK_TREE_MODEL (sidebar->store), &iter, PLACES_SIDEBAR_COLUMN_URI, &uri, -1); - g_assert (uri != NULL); - dest_file = g_file_new_for_uri (uri); + if (uri != NULL) { + GFile *dest_file = g_file_new_for_uri (uri); - emit_drag_action_requested (sidebar, context, dest_file, sidebar->drag_list, &action); + emit_drag_action_requested (sidebar, context, dest_file, sidebar->drag_list, &action); - g_object_unref (dest_file); - g_free (uri); + g_object_unref (dest_file); + g_free (uri); + } /* uri may be NULL for unmounted volumes, for example, so we don't allow drops there */ } } } -- 2.30.2